# -*- coding: utf-8 -*-
import scrapy
from Spider.items import *

class ListtextspiderSpider(scrapy.Spider):
    name = 'ListTextSpider'
    allowed_domains = ['www.80txt.com']
    start_urls = ['https://www.80txt.com/sort3/1.html']
    
    def parse(self, response):
        divlist = response.xpath('//*[@id="list_art_2013"]');
        items = []
        print('11111111111111111')
        for div in divlist:
            print(div.xpath('div[2]/a/img/@title').extract()[0])
            item = SpiderItem()
            item['bookName'] = div.xpath('div[2]/a/img/@title').extract()[0]
            item['bookUrl'] = div.xpath('div[1]/div[1]/div[1]/a/@href').extract()[0]
            item['bookAuthor'] = div.xpath('div[1]/div[3]/span/a/text()').extract()[0]
            items.append(item)
        return items;


